import request from '@/common/request';

export default {
  state: {
    list: [],
  },
  mutations: {
    loadRestaurant(state, payload) {
      state.list = payload.list;
    },
  },
  actions: {
    async loadRestaurant({ commit }) {
      const result = await request({
        url: '/restaurant/location/-74.0059413,40.7127837',
        method: 'GET',
      });
      commit('loadRestaurant', { list: result.list });
    },
  },
};
